/**
 * 文件名称：MeasurementDaoImpl.java
 * 文件版权：ChinaParasol Technologies Co., Ltd. Copyright 2000-2020,  All rights reserved
 * 文件描述：<描述>
 * 创建作者：Administrator
 * 创建时间：Jan 5, 2013
 * 修改内容：<修改内容>
 */
package com.parasol.hcerp.service.measurement.dao;

import java.util.List;

import com.parasol.hcerp.common.jdbc.ParasolSQLSuport;
import com.parasol.hcerp.service.measurement.domain.MeasurementBean;

/**
 * 
 * @author  Administrator
 * @version V1.0, Jan 5, 2013
 */
public class MeasurementDaoImpl implements MeasurementDao
{
    
    private ParasolSQLSuport parasolSQLSuport = null;
    
    public ParasolSQLSuport getParasolSQLSuport()
    {
        return parasolSQLSuport;
    }

    public void setParasolSQLSuport(ParasolSQLSuport parasolSQLSuport)
    {
        this.parasolSQLSuport = parasolSQLSuport;
    }

    public int checkExist(String measurementname)
    {
        String result = String.valueOf(parasolSQLSuport.queryForObject("measurement.checkExist", measurementname));
        return Integer.parseInt(result);
    }
    
    public void deleteForMeasurement(String measurementid)
    {
        parasolSQLSuport.delete("measurement.deleteForMeasurement", measurementid);
    }
    
    public MeasurementBean queryForMeasurement(String measurementid)
    {
        return (MeasurementBean)parasolSQLSuport.queryForObject("measurement.queryForMeasurement", measurementid);
    }
    
    @SuppressWarnings("unchecked")
    public List<MeasurementBean> queryForMeasurementList()
    {
        return (List<MeasurementBean>)parasolSQLSuport.queryForList("measurement.queryForMeasurementList");
    }
    
    public void saveForMeasurement(MeasurementBean measurementBean)
    {
        parasolSQLSuport.insert("measurement.saveForMeasurement", measurementBean);
    }
    
    public void updateForMeasurement(MeasurementBean measurementBean)
    {
        parasolSQLSuport.update("measurement.updateForMeasurement", measurementBean);
    }
    
}
